package com.neuqsoft.rd.citizen.thirdapp;

import com.neuqsoft.api.client.DefaultNeuqClient;
import com.neuqsoft.rd.citizen.thirdapp.demo.DemoConstant;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
public class CitizenThirdAppDemoApplication {

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

    @Bean
    public DefaultNeuqClient demoNeuqClient() throws Exception {
        String appId = DemoConstant.APPID;
        String privateKey = DemoConstant.APP_PRIVATE_KEY;
        String neuqPublicKey = DemoConstant.NEUQ_PUBLIC_KEY;
        String encryptKey = DemoConstant.ENCRYPT_KEY;
        return new DefaultNeuqClient("", appId, privateKey, neuqPublicKey, "RSA2", encryptKey, "AES");
    }

    public static void main(String[] args) {
        SpringApplication.run(CitizenThirdAppDemoApplication.class, args);
    }

}
